import { createPortal } from "react-dom";

import { SliderGallery } from "../Customs/SliderGallery";

interface Props {
  arr: TaskFile[];
  open: boolean;
  setOpen: (value: boolean) => void;
  activeSliderIndex: number;
}

export const TaskSlider = (props: Props) => {
  const { arr, open = false, setOpen, activeSliderIndex, } = props;

  return (
    <>
      {open &&
        createPortal(
          <SliderGallery
            files={arr}
            setOpen={setOpen}
            activeSliderIndex={activeSliderIndex}
          />,
          document.body,
        )}
    </>
  );
};
